// Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi space 
// Source File Name:   HAxisLabel.java

package com.java4less.rchart;

import com.java4less.rchart.gc.ChartColor;
import com.java4less.rchart.gc.ChartFont;
import com.java4less.rchart.gc.ChartGraphics;

// Referenced classes of package com.java4less.rchart:
//			AxisLabel, ChartLabel

public class HAxisLabel extends AxisLabel
{

	public HAxisLabel(String t, ChartColor c, ChartFont f)
	{
		super(t, c, f);
	}

	protected void draw(ChartGraphics g)
	{
		g.setColor(color);
		g.setFont(font);
		if (title.indexOf("@") >= 0)
		{
			ChartLabel formattedLabel = new ChartLabel(title, "", vertical, true);
			formattedLabel.initialize(g, chart);
			formattedLabel.paint(g, x, y, width, height);
			return;
		}
		int w = g.getFontWidth(title);
		int toCenterX = 0;
		if (w < width)
			toCenterX = (width - w) / 2;
		int h = g.getFontHeight();
		int toCenterY = height;
		if (h < height)
			toCenterY = (height - h) / 2;
		g.drawString(title, x + toCenterX, y + toCenterY + h);
	}
}
